import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.sql.SQLException;
import java.util.HashSet;
import java.util.Set;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableColumnModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.swing.table.*;

/*
 * Menu.java
 *
 * Created on __DATE__, __TIME__
 */

/**
 *
 * @author  __USER__
 */
public class Menu extends javax.swing.JFrame {
    private Frame parent2;
    private JLabel sfondo;
    private JLabel sfondobase;
    private JLabel sfondobarra;
    private JLabel sfondobarra2;
    private JLabel sfondobarra3;
    private JLabel sfondobarra4;
    private JLabel sfondobarra5;
    private JLabel sfondobarra6;
    private JLabel sfondobarra7;
    private JLabel sfondobarra8;

	/** Creates new form Menu */
	public Menu() {
		initComponents();
                  Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
		this.setLocation(new Point(
				(dimension.width - this.getSize().width) / 2,
				(dimension.height - this.getSize().height) / 2));
              
                inizialize();

	}

      //serve a personalizzare con una combobox la tabella componenti  
   private void PersTab(){
                  tabellacomp.setForeground(Color.white);
                  tabellacomp.setOpaque(true);
                 JTextField f=new JTextField();
                 f.setSize(5, 20);
                 f.setLayout(null);
                 JLabel lab=new JLabel();
                 lab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sfondomenu.png")));
                
                 lab.setVisible(true);
                 f.add(lab);
                 f.setBackground(Color.red);
                 f.setOpaque(true);
                 tabellacomp.setDefaultRenderer(String.class, new TableCellRenderer() {

            @Override
            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                 JLabel lab=new JLabel();
                 lab.setBackground(Color.white);
                 
                 lab.setOpaque(true);
                 if(isSelected){ lab.setBackground(Color.lightGray);}
                 return lab;
            }
        });
                 tabellacomp.setDefaultRenderer(Boolean.class, new TableCellRenderer() {

            @Override
            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                 JLabel lab=new JLabel();
                 lab.setForeground(Color.white);
                 lab.setText("  "+Integer.toString(row+1));
                 lab.setBackground(Color.GRAY);
                 lab.setBounds(0, 0,50,50);
                 lab.setOpaque(true);
                 return lab;
            }
        });
                 
            
                 
                 
                 
                 
                 
                 JComboBox qta=new JComboBox();
                 
                for(int i=0;i<=50;i++)
                qta.addItem(new Integer(i));
                qta.setSelectedIndex(0);
                qta.setOpaque(true);
                qta.setVisible(true);
                
                tabellacomp.getColumnModel().getColumn(3).setCellEditor(new DefaultCellEditor(qta));
                tabellacomp.getColumnModel().getColumn(0).setPreferredWidth(2);
                tabellacomp.getColumnModel().getColumn(2).setPreferredWidth(tabellacomp.getColumnModel().getColumn(2).getPreferredWidth()+100);
                tabellacomp.getColumnModel().getColumn(3).setPreferredWidth(2);
                tabellacomp.getColumnModel().getColumn(4).setPreferredWidth(2);
                tabellacomp.getColumnModel().getColumn(4).setCellEditor(new DefaultCellEditor(qta));
                tabellacomp.getColumnModel().getColumn(2).setCellEditor(new PanelEditor());
                
                refresh();
                 }    
        
   
  

   
   
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Pannellogenerale = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jFormattedTextField1 = new javax.swing.JFormattedTextField();
        jLabel15 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jToggleButton2 = new javax.swing.JToggleButton();
        salvabottone = new javax.swing.JButton();
        apribottonemenu = new javax.swing.JToggleButton();
        log = new javax.swing.JButton();
        filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 2), new java.awt.Dimension(0, 2), new java.awt.Dimension(32767, 2));
        jButton7 = new javax.swing.JButton();
        pannelloInfo = new javax.swing.JPanel();
        jLabel21 = new javax.swing.JLabel();
        jTextField14 = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jTextField16 = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        jTextField17 = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        ncalzata = new javax.swing.JComboBox();
        UomoBox = new javax.swing.JCheckBox();
        Donnabox = new javax.swing.JCheckBox();
        jToggleButton3 = new javax.swing.JToggleButton();
        jToggleButton5 = new javax.swing.JToggleButton();
        jComboBox1 = new javax.swing.JComboBox();
        jLabel30 = new javax.swing.JLabel();
        Bimbobox = new javax.swing.JCheckBox();
        jPanel3 = new javax.swing.JPanel();
        jLabel27 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        Ukbox = new javax.swing.JCheckBox();
        Usabox = new javax.swing.JCheckBox();
        EUbox = new javax.swing.JCheckBox();
        jButton4 = new javax.swing.JButton();
        Pannellocomp = new javax.swing.JPanel();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jScrollPane5 = new javax.swing.JScrollPane();
        tabellacomp = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jTextField9 = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jTextField10 = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jTextField11 = new javax.swing.JTextField();
        jButton12 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        confronta = new javax.swing.JButton();
        jTabbedPane3 = new javax.swing.JTabbedPane();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable4 = new javax.swing.JTable();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTable5 = new javax.swing.JTable();
        jTabbedPane4 = new javax.swing.JTabbedPane();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTable6 = new javax.swing.JTable();
        jScrollPane7 = new javax.swing.JScrollPane();
        jTable7 = new javax.swing.JTable();
        jLabel7 = new javax.swing.JLabel();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel9 = new javax.swing.JLabel();
        jSeparator6 = new javax.swing.JSeparator();
        jLabel10 = new javax.swing.JLabel();
        jSeparator7 = new javax.swing.JSeparator();
        jPanel4 = new javax.swing.JPanel();
        jLabel31 = new javax.swing.JLabel();
        pannelloLog = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jLabel42 = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        jButton3 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        Cancellalogselezionato = new javax.swing.JButton();
        aprilog = new javax.swing.JToggleButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        pannellofoto = new javax.swing.JPanel();
        jLabel29 = new javax.swing.JLabel();
        jSeparator5 = new javax.swing.JSeparator();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel6 = new javax.swing.JLabel();
        immagine1 = new javax.swing.JPanel();
        jButton15 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jSeparator4 = new javax.swing.JSeparator();
        immagine2 = new javax.swing.JPanel();
        jButton16 = new javax.swing.JButton();
        jButton17 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jButton21 = new javax.swing.JButton();
        jButton22 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jButton23 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jMenuBar4 = new javax.swing.JMenuBar();
        scheda = new javax.swing.JMenu();
        nuova = new javax.swing.JMenuItem();
        Aprischeda = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        impscbase = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();
        menuNuovoModelloBase = new javax.swing.JMenuItem();
        Apribase = new javax.swing.JMenuItem();
        jSeparator9 = new javax.swing.JPopupMenu.Separator();
        salva = new javax.swing.JMenuItem();
        salvaconnome = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenu7 = new javax.swing.JMenu();
        aggiungi = new javax.swing.JMenuItem();
        CercaComp = new javax.swing.JMenuItem();
        jMenu6 = new javax.swing.JMenu();
        forn = new javax.swing.JMenu();
        insfor = new javax.swing.JMenuItem();
        cerfor = new javax.swing.JMenuItem();
        jSeparator8 = new javax.swing.JPopupMenu.Separator();
        clienti = new javax.swing.JMenu();
        cliinserisci = new javax.swing.JMenuItem();
        clicerca = new javax.swing.JMenuItem();
        agenti = new javax.swing.JMenu();
        agenins = new javax.swing.JMenuItem();
        cercains = new javax.swing.JMenuItem();
        commerciale = new javax.swing.JMenu();
        schedaprodotto = new javax.swing.JMenuItem();
        jMenu8 = new javax.swing.JMenu();
        jMenuItem9 = new javax.swing.JMenuItem();
        cercaordine = new javax.swing.JMenuItem();
        jMenu9 = new javax.swing.JMenu();
        comsped = new javax.swing.JMenuItem();
        Cercasped = new javax.swing.JMenuItem();
        ingrandisci = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setAlwaysOnTop(true);
        setBackground(new java.awt.Color(153, 153, 255));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setExtendedState(4);
        setForeground(new java.awt.Color(0, 0, 255));
        setIconImages(null);
        setUndecorated(true);
        addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                formMouseReleased(evt);
            }
        });

        Pannellogenerale.setVisible(true);
        Pannellogenerale.setBackground(new java.awt.Color(204, 204, 255));
        Pannellogenerale.setDoubleBuffered(false);
        Pannellogenerale.setMaximumSize(new java.awt.Dimension(32769, 32769));

        jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabel8.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("Data Inserimento");

        jFormattedTextField1.setBackground(new java.awt.Color(240, 240, 240));
        jFormattedTextField1.setEnabled(false);
        jFormattedTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFormattedTextField1ActionPerformed(evt);
            }
        });

        jLabel15.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel15.setForeground(new java.awt.Color(255, 255, 255));
        jLabel15.setText("Ultima modifica");

        jTextField1.setEnabled(false);
        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });

        jToggleButton2.setSelected(true);
        jToggleButton2.setToolTipText("Carica Ultima Modifica");
        jToggleButton2.setBorder(null);
        jToggleButton2.setBorderPainted(false);
        jToggleButton2.setContentAreaFilled(false);

        salvabottone.setToolTipText("Salva scheda");
        salvabottone.setBorder(null);
        salvabottone.setBorderPainted(false);
        salvabottone.setContentAreaFilled(false);
        salvabottone.setDefaultCapable(false);
        salvabottone.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                salvabottoneMouseClicked(evt);
            }
        });

        apribottonemenu.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Open (2).png"))); // NOI18N
        apribottonemenu.setSelected(true);
        apribottonemenu.setToolTipText("Apri scheda");
        apribottonemenu.setBorder(null);
        apribottonemenu.setBorderPainted(false);
        apribottonemenu.setContentAreaFilled(false);
        apribottonemenu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                apribottonemenuMouseClicked(evt);
            }
        });

        log.setIcon(new javax.swing.ImageIcon("C:\\Users\\Stefano\\Desktop\\Toggle Log.png")); // NOI18N
        log.setToolTipText("Scorri Log");
        log.setBorder(null);
        log.setBorderPainted(false);
        log.setContentAreaFilled(false);
        log.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                logMouseClicked(evt);
            }
        });
        log.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logActionPerformed(evt);
            }
        });

        jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Save.png"))); // NOI18N
        jButton7.setToolTipText("Salva");
        jButton7.setBorderPainted(false);
        jButton7.setContentAreaFilled(false);
        jButton7.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton7MouseClicked(evt);
            }
        });
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(4, 4, 4)
                .addComponent(apribottonemenu, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(log)
                .addGap(22, 22, 22)
                .addComponent(salvabottone)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(198, 198, 198)
                        .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jToggleButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jToggleButton2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(apribottonemenu, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(salvabottone, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(log, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel8)
                .addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel15))
            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pannelloInfo.setBackground(new java.awt.Color(255, 255, 255));
        pannelloInfo.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabel21.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel21.setForeground(new java.awt.Color(255, 255, 255));
        jLabel21.setText("Nome ");

        jLabel22.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel22.setForeground(new java.awt.Color(255, 255, 255));
        jLabel22.setText("Linea");

        jLabel23.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel23.setForeground(new java.awt.Color(255, 255, 255));
        jLabel23.setText("Tipologia");

        jLabel24.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel24.setForeground(new java.awt.Color(255, 255, 255));
        jLabel24.setText("Modello base");

        jLabel25.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel25.setForeground(new java.awt.Color(255, 255, 255));
        jLabel25.setText("Calzata");

        jLabel28.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel28.setForeground(new java.awt.Color(255, 255, 255));
        jLabel28.setText("Sesso");

        ncalzata.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", " " }));
        ncalzata.setToolTipText("");

        UomoBox.setText("M");
        UomoBox.setContentAreaFilled(false);

        Donnabox.setText("F");
        Donnabox.setContentAreaFilled(false);

        jToggleButton3.setToolTipText("Cerca Modello Base");
        jToggleButton3.setBorder(null);
        jToggleButton3.setContentAreaFilled(false);
        jToggleButton3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jToggleButton3MouseClicked(evt);
            }
        });

        jToggleButton5.setToolTipText("Cerca Linea");
        jToggleButton5.setBorder(null);
        jToggleButton5.setContentAreaFilled(false);
        jToggleButton5.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jToggleButton5MouseClicked(evt);
            }
        });

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Ballerine", "Sneakers", "Sandali", "Stringate", "Scarpe alte", "Scarpe aperte", "Scarpe eleganti", "Scarpe sportive", "Scarpe basse", "Stivaletti", "Stivali", "Scarpe da trekking", "Ciabattine\\Zoccoli", "Pantofole", "Scarpe neonati", "Per il mare" }));

        jLabel30.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel30.setForeground(new java.awt.Color(255, 255, 255));
        jLabel30.setText("Bimbo\\a");

        Bimbobox.setContentAreaFilled(false);

        jPanel3.setBackground(new java.awt.Color(0, 51, 204));

        jLabel27.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel27.setForeground(new java.awt.Color(255, 255, 255));
        jLabel27.setText("Info Campione");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel27)
                .addGap(229, 229, 229))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jLabel27)
                .addGap(0, 4, Short.MAX_VALUE))
        );

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Open (2).png"))); // NOI18N
        jButton1.setToolTipText("Apri");
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton1MouseClicked(evt);
            }
        });

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Open (2).png"))); // NOI18N
        jButton2.setToolTipText("Apri");
        jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton2MouseClicked(evt);
            }
        });

        Ukbox.setText("Uk");
        Ukbox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                UkboxMouseClicked(evt);
            }
        });

        Usabox.setText("Usa");

        EUbox.setText("EU");

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Plus.png"))); // NOI18N

        javax.swing.GroupLayout pannelloInfoLayout = new javax.swing.GroupLayout(pannelloInfo);
        pannelloInfo.setLayout(pannelloInfoLayout);
        pannelloInfoLayout.setHorizontalGroup(
            pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pannelloInfoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel21)
                    .addComponent(jLabel23)
                    .addComponent(jLabel22)
                    .addComponent(jLabel24, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pannelloInfoLayout.createSequentialGroup()
                        .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(Bimbobox)
                            .addGroup(pannelloInfoLayout.createSequentialGroup()
                                .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(UomoBox)
                                    .addComponent(ncalzata, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(pannelloInfoLayout.createSequentialGroup()
                                        .addComponent(Ukbox)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(Usabox)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(EUbox))
                                    .addComponent(Donnabox))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jToggleButton3))
                    .addGroup(pannelloInfoLayout.createSequentialGroup()
                        .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(pannelloInfoLayout.createSequentialGroup()
                                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE))
                            .addGroup(pannelloInfoLayout.createSequentialGroup()
                                .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTextField17, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE))))
                        .addGap(127, 127, 127)
                        .addComponent(jToggleButton5)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
            .addGroup(pannelloInfoLayout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        pannelloInfoLayout.setVerticalGroup(
            pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pannelloInfoLayout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(pannelloInfoLayout.createSequentialGroup()
                        .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel21)
                            .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel23)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel22)
                            .addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(9, 9, 9)
                        .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel24)
                            .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(3, 3, 3))
                    .addComponent(jToggleButton5))
                .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pannelloInfoLayout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jToggleButton3))
                    .addGroup(pannelloInfoLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel25)
                            .addComponent(ncalzata, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(Ukbox)
                            .addComponent(Usabox)
                            .addComponent(EUbox))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel28)
                    .addComponent(UomoBox)
                    .addComponent(Donnabox))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pannelloInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel30)
                    .addComponent(Bimbobox))
                .addContainerGap())
        );

        Pannellocomp.setBackground(new java.awt.Color(153, 153, 153));
        Pannellocomp.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        tabellacomp.setBackground(new java.awt.Color(153, 153, 153));
        tabellacomp.setFont(new java.awt.Font("Calibri", 3, 12)); // NOI18N
        tabellacomp.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"1", null, null, null, null},
                {"2", null, null, null, null},
                {"3", null, null, null, null},
                {"4", null, null, null, null},
                {"5", null, null, null, null},
                {"6", null, null, null, null},
                {"7", null, null, null, null},
                {"8", null, null, null, null},
                {"9", null, null, null, null},
                {"10", null, null, null, null},
                {"11", null, null, null, null},
                {"12", null, null, null, null},
                {"13", null, null, null, null},
                {"14", null, null, null, null},
                {"15", null, null, null, null},
                {"16", null, null, null, null},
                {"17", null, null, null, null},
                {"18", null, null, null, null},
                {"19", null, null, null, null},
                {"20", null, null, null, null},
                {"21", null, null, null, null},
                {"22", null, null, null, null},
                {"23", null, null, null, null},
                {"24", null, null, null, null},
                {"25", null, null, null, null},
                {"26", null, null, null, null},
                {"27", null, null, null, null},
                {"28", null, null, null, null},
                {"29", null, null, null, null},
                {"30", null, null, null, null},
                {"31", null, null, null, null},
                {"32", null, null, null, null},
                {"33", null, null, null, null},
                {"34", null, null, null, null},
                {"35", null, null, null, null},
                {"36", null, null, null, null},
                {"37", null, null, null, null},
                {"38", null, null, null, null},
                {"39", null, null, null, null},
                {"40", null, null, null, null},
                {"41", null, null, null, null},
                {"42", null, null, null, null},
                {"43", null, null, null, null},
                {"44", null, null, null, null},
                {"45", null, null, null, null},
                {"46", null, null, null, null},
                {"47", null, null, null, null},
                {"48", null, null, null, null},
                {"49", null, null, null, null},
                {"50", null, null, null, null}
            },
            new String [] {
                "", "Posizione", "Descrizione", "Quantità", "Taglia"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabellacomp.setToolTipText("");
        tabellacomp.setGridColor(new java.awt.Color(102, 102, 102));
        tabellacomp.setOpaque(false);
        jScrollPane5.setViewportView(tabellacomp);

        jTabbedPane2.addTab("Componenti", jScrollPane5);

        jLabel16.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel16.setForeground(new java.awt.Color(255, 255, 255));
        jLabel16.setText("Costo produzione cam.");

        jLabel17.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel17.setForeground(new java.awt.Color(255, 255, 255));
        jLabel17.setText("Costo prod.finito");

        jLabel18.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel18.setForeground(new java.awt.Color(255, 255, 255));
        jLabel18.setText("Stima prezzo p.f.");

        jButton12.setToolTipText("Confronta");
        jButton12.setBorder(null);
        jButton12.setBorderPainted(false);
        jButton12.setContentAreaFilled(false);
        jButton12.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton12MouseClicked(evt);
            }
        });

        jButton13.setToolTipText("Visualizza scheda");
        jButton13.setBorder(null);
        jButton13.setBorderPainted(false);
        jButton13.setContentAreaFilled(false);
        jButton13.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton13MouseClicked(evt);
            }
        });

        confronta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cost.png"))); // NOI18N
        confronta.setToolTipText("Confronta");
        confronta.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                confrontaMouseClicked(evt);
            }
        });
        confronta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                confrontaActionPerformed(evt);
            }
        });

        jTable4.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Nome", "Importo"
            }
        ));
        jScrollPane2.setViewportView(jTable4);

        jTabbedPane3.addTab("Costi Fissi Campione", jScrollPane2);

        jTable5.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Nome ", "Importo"
            }
        ));
        jScrollPane4.setViewportView(jTable5);

        jTabbedPane3.addTab("Costi Fissi Prodotto Finito", jScrollPane4);

        jTable6.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Nome", "Importo"
            }
        ));
        jScrollPane6.setViewportView(jTable6);

        jTabbedPane4.addTab("Costi Variabili Campione", jScrollPane6);

        jTable7.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Nome ", "Importo"
            }
        ));
        jScrollPane7.setViewportView(jTable7);

        jTabbedPane4.addTab("Costi Variabili Prodotto Finito", jScrollPane7);

        jLabel7.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(0, 51, 204));
        jLabel7.setText("Riassunto");

        jLabel9.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel9.setForeground(new java.awt.Color(0, 51, 204));
        jLabel9.setText("Variabili");

        jLabel10.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel10.setForeground(new java.awt.Color(0, 51, 204));
        jLabel10.setText("Fissi");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(jButton12))
                                    .addComponent(jLabel9))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jSeparator6, javax.swing.GroupLayout.PREFERRED_SIZE, 345, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButton13))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel7)
                                    .addComponent(jLabel16)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel17)
                                            .addComponent(jLabel18))
                                        .addGap(68, 68, 68)
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(jPanel2Layout.createSequentialGroup()
                                                .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(confronta, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addContainerGap())
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTabbedPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 405, Short.MAX_VALUE)
                            .addComponent(jTabbedPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel10)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jSeparator7)))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 358, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(confronta, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel16)
                                    .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel17)
                            .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel18)
                            .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(8, 8, 8)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jSeparator6, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jButton13)
                            .addComponent(jButton12))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTabbedPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jSeparator7, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addGap(12, 12, 12)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTabbedPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(23, 23, 23))
        );

        jTabbedPane2.addTab("Costi", jPanel2);

        jPanel4.setBackground(new java.awt.Color(0, 51, 204));

        jLabel31.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel31.setForeground(new java.awt.Color(255, 255, 255));
        jLabel31.setText("Componenti");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel31)
                .addContainerGap(336, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jLabel31)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout PannellocompLayout = new javax.swing.GroupLayout(Pannellocomp);
        Pannellocomp.setLayout(PannellocompLayout);
        PannellocompLayout.setHorizontalGroup(
            PannellocompLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PannellocompLayout.createSequentialGroup()
                .addGroup(PannellocompLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PannellocompLayout.createSequentialGroup()
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PannellocompLayout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 428, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        PannellocompLayout.setVerticalGroup(
            PannellocompLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PannellocompLayout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane2))
        );

        pannelloLog.setBackground(new java.awt.Color(255, 255, 255));
        pannelloLog.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jPanel10.setBackground(new java.awt.Color(0, 0, 204));

        jLabel42.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel42.setForeground(new java.awt.Color(255, 255, 255));
        jLabel42.setText("Log");

        jPanel11.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jButton3.setToolTipText("Cerca nel Log");
        jButton3.setBorder(null);
        jButton3.setBorderPainted(false);
        jButton3.setContentAreaFilled(false);
        jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton3MouseClicked(evt);
            }
        });

        jButton5.setToolTipText("Apri");
        jButton5.setBorder(null);
        jButton5.setBorderPainted(false);
        jButton5.setContentAreaFilled(false);

        Cancellalogselezionato.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Eraser.png"))); // NOI18N
        Cancellalogselezionato.setToolTipText("Cancella Log");
        Cancellalogselezionato.setBorderPainted(false);
        Cancellalogselezionato.setContentAreaFilled(false);
        Cancellalogselezionato.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                CancellalogselezionatoMouseClicked(evt);
            }
        });

        aprilog.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Open (2).png"))); // NOI18N
        aprilog.setSelected(true);
        aprilog.setToolTipText("Apri Log Selezionato");
        aprilog.setBorder(null);
        aprilog.setBorderPainted(false);
        aprilog.setContentAreaFilled(false);
        aprilog.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                aprilogMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addComponent(jButton5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(aprilog, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Cancellalogselezionato, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton3)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jButton5)
            .addComponent(jButton3)
            .addComponent(Cancellalogselezionato, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(aprilog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel42)
                .addContainerGap())
            .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(jLabel42)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jTable2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Data", "Ora", "Descrizione"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, true
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane3.setViewportView(jTable2);

        javax.swing.GroupLayout pannelloLogLayout = new javax.swing.GroupLayout(pannelloLog);
        pannelloLog.setLayout(pannelloLogLayout);
        pannelloLogLayout.setHorizontalGroup(
            pannelloLogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        pannelloLogLayout.setVerticalGroup(
            pannelloLogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pannelloLogLayout.createSequentialGroup()
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
        );

        pannellofoto.setBackground(new java.awt.Color(255, 255, 255));
        pannellofoto.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabel29.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel29.setForeground(new java.awt.Color(0, 0, 255));
        jLabel29.setText("Note");

        jLabel6.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(0, 51, 204));
        jLabel6.setText("Immagini campione");

        immagine1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout immagine1Layout = new javax.swing.GroupLayout(immagine1);
        immagine1.setLayout(immagine1Layout);
        immagine1Layout.setHorizontalGroup(
            immagine1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 187, Short.MAX_VALUE)
        );
        immagine1Layout.setVerticalGroup(
            immagine1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 131, Short.MAX_VALUE)
        );

        jButton15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Zoom In.png"))); // NOI18N
        jButton15.setToolTipText("Zoom");
        jButton15.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton15ActionPerformed(evt);
            }
        });

        jButton10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Modify.png"))); // NOI18N
        jButton10.setToolTipText("Modifica");
        jButton10.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        immagine2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        javax.swing.GroupLayout immagine2Layout = new javax.swing.GroupLayout(immagine2);
        immagine2.setLayout(immagine2Layout);
        immagine2Layout.setHorizontalGroup(
            immagine2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 183, Short.MAX_VALUE)
        );
        immagine2Layout.setVerticalGroup(
            immagine2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 131, Short.MAX_VALUE)
        );

        jButton16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/right.png"))); // NOI18N
        jButton16.setToolTipText("Successivo");
        jButton16.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jButton17.setIcon(new javax.swing.ImageIcon(getClass().getResource("/left.png"))); // NOI18N
        jButton17.setToolTipText("Precedente");
        jButton17.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jScrollPane1.setViewportView(jTextArea1);

        jButton21.setIcon(new javax.swing.ImageIcon(getClass().getResource("/left.png"))); // NOI18N
        jButton21.setToolTipText("Precedente");
        jButton21.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jButton22.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Zoom In.png"))); // NOI18N
        jButton22.setToolTipText("Zoom");
        jButton22.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jButton22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton22ActionPerformed(evt);
            }
        });

        jButton11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Modify.png"))); // NOI18N
        jButton11.setToolTipText("Modifica");
        jButton11.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jButton23.setIcon(new javax.swing.ImageIcon(getClass().getResource("/right.png"))); // NOI18N
        jButton23.setToolTipText("Successivo");
        jButton23.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jPanel5.setBackground(new java.awt.Color(0, 0, 153));
        jPanel5.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Altro");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addGap(0, 433, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1)
        );

        javax.swing.GroupLayout pannellofotoLayout = new javax.swing.GroupLayout(pannellofoto);
        pannellofoto.setLayout(pannellofotoLayout);
        pannellofotoLayout.setHorizontalGroup(
            pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pannellofotoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pannellofotoLayout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pannellofotoLayout.createSequentialGroup()
                        .addComponent(jLabel29)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator4)
                        .addGap(6, 6, 6))
                    .addGroup(pannellofotoLayout.createSequentialGroup()
                        .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pannellofotoLayout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pannellofotoLayout.createSequentialGroup()
                                .addGap(9, 9, 9)
                                .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(pannellofotoLayout.createSequentialGroup()
                                        .addComponent(jButton15, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jButton17, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(immagine1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(59, 59, 59)
                                .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(pannellofotoLayout.createSequentialGroup()
                                        .addComponent(jButton22, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jButton21, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jButton23, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(immagine2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 449, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
            .addGroup(pannellofotoLayout.createSequentialGroup()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        pannellofotoLayout.setVerticalGroup(
            pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pannellofotoLayout.createSequentialGroup()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pannellofotoLayout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addComponent(jLabel6))
                    .addGroup(pannellofotoLayout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(100, 100, 100)
                .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pannellofotoLayout.createSequentialGroup()
                        .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(immagine1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(immagine2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton17)
                            .addComponent(jButton16)
                            .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jButton10)
                                .addComponent(jButton15))
                            .addComponent(jButton21)
                            .addComponent(jButton23)
                            .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jButton11)
                                .addComponent(jButton22)))
                        .addGroup(pannellofotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pannellofotoLayout.createSequentialGroup()
                                .addGap(34, 34, 34)
                                .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 4, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pannellofotoLayout.createSequentialGroup()
                                .addGap(26, 26, 26)
                                .addComponent(jLabel29))))
                    .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1)
                .addContainerGap())
        );

        javax.swing.GroupLayout PannellogeneraleLayout = new javax.swing.GroupLayout(Pannellogenerale);
        Pannellogenerale.setLayout(PannellogeneraleLayout);
        PannellogeneraleLayout.setHorizontalGroup(
            PannellogeneraleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PannellogeneraleLayout.createSequentialGroup()
                .addContainerGap(48, Short.MAX_VALUE)
                .addComponent(Pannellocomp, javax.swing.GroupLayout.PREFERRED_SIZE, 433, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(PannellogeneraleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(pannelloInfo, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pannelloLog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addComponent(pannellofoto, javax.swing.GroupLayout.PREFERRED_SIZE, 474, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(71, 71, 71))
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        PannellogeneraleLayout.setVerticalGroup(
            PannellogeneraleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PannellogeneraleLayout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(PannellogeneraleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pannellofoto, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(PannellogeneraleLayout.createSequentialGroup()
                        .addComponent(pannelloInfo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(pannelloLog, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(Pannellocomp, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jMenuBar4.setBackground(new java.awt.Color(102, 102, 102));
        jMenuBar4.setForeground(new java.awt.Color(153, 153, 153));

        scheda.setBackground(new java.awt.Color(153, 153, 153));
        scheda.setForeground(new java.awt.Color(255, 255, 255));
        scheda.setText("Scheda");
        scheda.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                schedaMouseReleased(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                schedaMousePressed(evt);
            }
        });
        scheda.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                schedaKeyPressed(evt);
            }
        });

        nuova.setText("Nuova");
        nuova.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                nuovaMouseReleased(evt);
            }
        });
        scheda.add(nuova);

        Aprischeda.setText("Apri");
        scheda.add(Aprischeda);
        scheda.add(jSeparator1);

        impscbase.setText("Imposta scheda base");
        impscbase.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                impscbaseMouseReleased1(evt);
            }
        });
        scheda.add(impscbase);

        jMenu5.setText("Modello Base");

        menuNuovoModelloBase.setText("Nuovo");
        menuNuovoModelloBase.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                menuNuovoModelloBaseMouseReleased(evt);
            }
        });
        jMenu5.add(menuNuovoModelloBase);

        Apribase.setText("Apri");
        Apribase.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                ApribaseMouseReleased(evt);
            }
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                ApribaseMouseClicked(evt);
            }
        });
        jMenu5.add(Apribase);

        scheda.add(jMenu5);
        scheda.add(jSeparator9);

        salva.setText("Salva");
        scheda.add(salva);

        salvaconnome.setText("Salva con nome");
        salvaconnome.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                salvaconnomeMouseReleased(evt);
            }
        });
        scheda.add(salvaconnome);

        jMenuItem1.setText("Chiudi Scheda");
        jMenuItem1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jMenuItem1MouseReleased(evt);
            }
        });
        scheda.add(jMenuItem1);

        jMenuItem2.setText("Esci dal sistema");
        jMenuItem2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jMenuItem2MouseReleased(evt);
            }
        });
        scheda.add(jMenuItem2);

        jMenuBar4.add(scheda);

        jMenu1.setBackground(new java.awt.Color(153, 153, 153));
        jMenu1.setForeground(new java.awt.Color(255, 255, 255));
        jMenu1.setText("Linea");

        jMenuItem4.setText("Nuova");
        jMenuItem4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jMenuItem4MouseReleased(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jMenuItem4MousePressed(evt);
            }
        });
        jMenu1.add(jMenuItem4);

        jMenuItem5.setText("Apri");
        jMenuItem5.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jMenuItem5MousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jMenuItem5MouseReleased(evt);
            }
        });
        jMenu1.add(jMenuItem5);

        jMenuBar4.add(jMenu1);

        jMenu7.setBackground(new java.awt.Color(153, 153, 153));
        jMenu7.setForeground(new java.awt.Color(255, 255, 255));
        jMenu7.setText("Componenti");
        jMenu7.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jMenu7MouseReleased(evt);
            }
        });

        aggiungi.setText("Aggiungi");
        aggiungi.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                aggiungiMouseReleased(evt);
            }
        });
        jMenu7.add(aggiungi);

        CercaComp.setText("Apri");
        CercaComp.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CercaCompMouseReleased(evt);
            }
        });
        jMenu7.add(CercaComp);

        jMenuBar4.add(jMenu7);

        jMenu6.setBackground(new java.awt.Color(153, 153, 153));
        jMenu6.setForeground(new java.awt.Color(255, 255, 255));
        jMenu6.setText("Anagrafica");

        forn.setText("Fornitori");

        insfor.setText("Inserisci");
        insfor.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                insforMouseReleased(evt);
            }
        });
        forn.add(insfor);

        cerfor.setText("Apri");
        cerfor.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                cerforMouseReleased(evt);
            }
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cerforMouseClicked(evt);
            }
        });
        forn.add(cerfor);

        jMenu6.add(forn);
        jMenu6.add(jSeparator8);

        clienti.setText("Clienti");

        cliinserisci.setText("Inserisci");
        cliinserisci.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                cliinserisciMouseReleased(evt);
            }
        });
        clienti.add(cliinserisci);

        clicerca.setText("Apri");
        clicerca.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                clicercaMouseReleased(evt);
            }
        });
        clienti.add(clicerca);

        jMenu6.add(clienti);

        agenti.setText("Agenti");

        agenins.setText("Inserisci");
        agenins.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                ageninsMouseReleased(evt);
            }
        });
        agenti.add(agenins);

        cercains.setText("Apri");
        cercains.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                cercainsMouseReleased(evt);
            }
        });
        agenti.add(cercains);

        jMenu6.add(agenti);

        jMenuBar4.add(jMenu6);

        commerciale.setBackground(new java.awt.Color(153, 153, 153));
        commerciale.setForeground(new java.awt.Color(255, 255, 255));
        commerciale.setText("Commerciale");
        commerciale.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                commercialeMouseReleased(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                commercialeMousePressed(evt);
            }
        });

        schedaprodotto.setText("Scheda prodotto finito");
        schedaprodotto.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                schedaprodottoMouseReleased(evt);
            }
        });
        commerciale.add(schedaprodotto);

        jMenu8.setText("Gestione Ordini");

        jMenuItem9.setText("Compila Ordine");
        jMenuItem9.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jMenuItem9MouseReleased(evt);
            }
        });
        jMenu8.add(jMenuItem9);

        cercaordine.setText("Apri Elenco");
        cercaordine.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cercaordineMouseClicked(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                cercaordineMouseReleased(evt);
            }
        });
        jMenu8.add(cercaordine);

        commerciale.add(jMenu8);

        jMenu9.setText("Gestione Spedizioni");

        comsped.setText("Compila Spedizione");
        comsped.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                comspedMouseReleased(evt);
            }
        });
        jMenu9.add(comsped);

        Cercasped.setText("Cerca Spedizione");
        Cercasped.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                CercaspedMouseReleased(evt);
            }
        });
        jMenu9.add(Cercasped);

        commerciale.add(jMenu9);

        jMenuBar4.add(commerciale);

        ingrandisci.setBackground(new java.awt.Color(153, 153, 153));
        ingrandisci.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ingrandisci.png"))); // NOI18N
        ingrandisci.setDelay(10);
        ingrandisci.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                ingrandisciMouseReleased(evt);
            }
        });
        jMenuBar4.add(ingrandisci);

        setJMenuBar(jMenuBar4);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(Pannellogenerale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(Pannellogenerale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
   
  
    
    
    public void PannellogeneraleVisible(boolean flag){Pannellogenerale.setVisible(flag);
    }
    
    private void jMenu7MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenu7MouseReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenu7MouseReleased

    private void aggiungiMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aggiungiMouseReleased
       NuovoComponente sc = new NuovoComponente(this,true);
       sc.setVisible(true);// TODO add your h andling code here:
    }//GEN-LAST:event_aggiungiMouseReleased

    private void CercaCompMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CercaCompMouseReleased
         ApriComponenti ac = new ApriComponenti(this,true);
       ac.setVisible(true);     // TODO add your handling code here:
    }//GEN-LAST:event_CercaCompMouseReleased

    private void jFormattedTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFormattedTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jFormattedTextField1ActionPerformed

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1ActionPerformed

    private void formMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseReleased

    }//GEN-LAST:event_formMouseReleased

    private void commercialeMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_commercialeMouseReleased
    Schedaprodotto sp = new Schedaprodotto(this,true);
    sp.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_commercialeMouseReleased

    private void jButton13MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton13MouseClicked
    Schedaprodotto sp = new Schedaprodotto(this,false); 
    sp.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_jButton13MouseClicked

    private void commercialeMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_commercialeMousePressed
        // TODO add your handling code here:
    }//GEN-LAST:event_commercialeMousePressed

    private void schedaprodottoMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_schedaprodottoMouseReleased
      Schedaprodotto sp = new Schedaprodotto(this,false); 
    sp.setVisible(true);// TODO add your handling code here:   // TODO add your handling code here:
    }//GEN-LAST:event_schedaprodottoMouseReleased

    private void jButton12MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton12MouseClicked
     Confronto cf = new Confronto(this,true);
     cf.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_jButton12MouseClicked

    private void cliinserisciMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cliinserisciMouseReleased
    NuovaAnagrafica ai = new NuovaAnagrafica(this,true,2);
    ai.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_cliinserisciMouseReleased

    private void clicercaMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_clicercaMouseReleased
       ApriAnagrafica aa;
        try {
            aa = new ApriAnagrafica(this,true,2);
             aa.setVisible(true);
        } catch (SQLException ex) {
            Logger.getLogger(Menu.class.getName()).log(Level.SEVERE, null, ex);
        }
     // TODO add your handling code here:
    }//GEN-LAST:event_clicercaMouseReleased

    private void insforMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_insforMouseReleased
      NuovaAnagrafica ai = new NuovaAnagrafica(this,true,1);
    ai.setVisible(true);   // TODO add your handling code here:
    }//GEN-LAST:event_insforMouseReleased

    private void cerforMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cerforMouseReleased
      
        ApriAnagrafica aa;
        try {
            aa = new ApriAnagrafica(this,true,1);
            aa.setVisible(true);
        } catch (SQLException ex) {
            Logger.getLogger(Menu.class.getName()).log(Level.SEVERE, null, ex);
        }
       
    }//GEN-LAST:event_cerforMouseReleased

    private void ageninsMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ageninsMouseReleased
        NuovaAnagrafica ai = new NuovaAnagrafica(this,true,3);
    ai.setVisible(true);   // TODO add your handling code here:
    }//GEN-LAST:event_ageninsMouseReleased

    private void cercainsMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cercainsMouseReleased
       ApriAnagrafica ai;
        try {
            ai = new ApriAnagrafica(this,true,3);
             ai.setVisible(true);
        } catch (SQLException ex) {
            Logger.getLogger(Menu.class.getName()).log(Level.SEVERE, null, ex);
        }
    // TODO add your handling code here:
    }//GEN-LAST:event_cercainsMouseReleased

    private void jMenuItem9MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuItem9MouseReleased
  Ordine od= new Ordine (this,true);     
  od.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem9MouseReleased

    private void cercaordineMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cercaordineMouseClicked

    }//GEN-LAST:event_cercaordineMouseClicked

    private void cercaordineMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cercaordineMouseReleased
   ScorriOrdini co= new ScorriOrdini(this,true);
   co.setVisible(true);//        // TODO add your handling code here:
    }//GEN-LAST:event_cercaordineMouseReleased

    private void comspedMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_comspedMouseReleased
   Spedizione sp = new Spedizione(this,true);
   sp.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_comspedMouseReleased

    private void CercaspedMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CercaspedMouseReleased
       ScorriSpedizioni ss = new ScorriSpedizioni(this,true);
   ss.setVisible(true);  // TODO add your handling code here:
    }//GEN-LAST:event_CercaspedMouseReleased

    private void impscbaseMouseReleased1(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_impscbaseMouseReleased1

    SchedaBase sb = new SchedaBase(this,true);
    sb.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_impscbaseMouseReleased1

    private void salvabottoneMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_salvabottoneMouseClicked
      Confermasalva cs = new Confermasalva(this,true);
      cs.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_salvabottoneMouseClicked

    private void logActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_logActionPerformed

    private void jToggleButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jToggleButton3MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jToggleButton3MouseClicked

    private void jToggleButton5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jToggleButton5MouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jToggleButton5MouseClicked

    private void apribottonemenuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_apribottonemenuMouseClicked
    ApriScheda as = new ApriScheda(this,true);
    as.setVisible(true);
// TODO add your handling code here:
    }//GEN-LAST:event_apribottonemenuMouseClicked

    private void nuovaMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_nuovaMouseReleased
    this.inizializeTabella();
   this.Pannellogenerale.setVisible(true);
     
    salva.setVisible(true);
    salvaconnome.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_nuovaMouseReleased

    private void jButton7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton7MouseClicked
Confermasalva cs =new Confermasalva(this,true);
cs.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_jButton7MouseClicked

    private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked
        Cercadata cl = new Cercadata(parent2, true);
        cl.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_jButton3MouseClicked

    private void CancellalogselezionatoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CancellalogselezionatoMouseClicked
   Conferma cf = new Conferma(this,true);
   cf.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_CancellalogselezionatoMouseClicked

    private void confrontaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_confrontaMouseClicked
    Confronto cf = new Confronto(this,true);
    cf.setVisible(true);
   
    // TODO add your handling code here:
    }//GEN-LAST:event_confrontaMouseClicked

    private void logMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_logMouseClicked
ScorriLog sl = new ScorriLog(this,true);
sl.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_logMouseClicked

    private void ApribaseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ApribaseMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_ApribaseMouseClicked

    private void ApribaseMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ApribaseMouseReleased
      ApriModelloBase rb = new ApriModelloBase (this,true);
	rb.setVisible(true);//  // TODO add your handling code here:
    }//GEN-LAST:event_ApribaseMouseReleased

    private void salvaconnomeMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_salvaconnomeMouseReleased
SalvaconNome sv = new SalvaconNome(this,true);  
sv.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_salvaconnomeMouseReleased

    private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton15ActionPerformed

    private void jButton22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton22ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton22ActionPerformed

    private void confrontaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_confrontaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_confrontaActionPerformed

    private void aprilogMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_aprilogMouseClicked
ConfermaBase cb = new ConfermaBase(this,true);
cb.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_aprilogMouseClicked

    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked

 ApriLinea al= new ApriLinea(this,true);
     al.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_jButton1MouseClicked

    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
  ApriModelloBase ab= new ApriModelloBase(this,true);   
ab.setVisible(true);// TODO add your handling code here:
    }//GEN-LAST:event_jButton2MouseClicked

    private void cerforMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cerforMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_cerforMouseClicked

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton7ActionPerformed

    private void schedaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_schedaKeyPressed
   if (evt.getKeyCode() == KeyEvent.VK_RIGHT) {
       this.scheda.doClick();
    }        
    }//GEN-LAST:event_schedaKeyPressed

    private void UkboxMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_UkboxMouseClicked
   ////////////////////////////////////////////////////////////////////////////////////
   if(this.Ukbox.isSelected() && this.EUbox.isSelected()){
   this.EUbox.setSelected(false);
   this.Usabox.setSelected(false);
   int EU=Integer.parseInt(this.ncalzata.getSelectedItem().toString());
   double  Uk=-1;
   double Usa=-1;
   if(this.Bimbobox.isSelected()){double[] res=this.converti(EU, Uk, Usa, true, false);
                                  ncalzata.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "10", "10.5", "11", "11.5", "12", "12.5", "13", "13.5", 
                                                                                                        "14"}));
                                  ncalzata.setSelectedIndex(returnUkIndex(Uk));
                                  refresh();
   }
   if(this.Donnabox.isSelected()){double[] res=this.converti(EU, Uk, Usa, false, true);
                                  ncalzata.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "10", "10.5", "11", "11.5", "12", "12.5", "13", "13.5", 
                                                                                                        "14"}));
                                   ncalzata.setSelectedIndex(returnUkIndex(Uk));
                                  refresh();
   }
   
   if(this.UomoBox.isSelected()){double[] res=this.converti(EU, Uk, Usa, false, false);
                                  ncalzata.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "10", "10.5", "11", "11.5", "12", "12.5", "13", "13.5", 
                                                                                                        "14"}));
                                   ncalzata.setSelectedIndex(returnUkIndex(Uk));
                                  refresh();
   }
   }
   
   ///////////////////////////////////////////////////////////////////////////////////////
   if(this.Ukbox.isSelected() && this.Usabox.isSelected()){
   this.EUbox.setSelected(false);
   this.Usabox.setSelected(false);
   int EU=-1;
   double  Uk=-1;
   double Usa=Integer.parseInt(this.ncalzata.getSelectedItem().toString());;
   if(this.Bimbobox.isSelected()){double[] res=this.converti(EU, Uk, Usa, true, false);
                                  ncalzata.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "10", "10.5", "11", "11.5", "12", "12.5", "13", "13.5", 
                                                                                                        "14"}));
                                 
                                  ncalzata.setSelectedIndex(returnUkIndex(Uk));
                                  
                                  refresh();
   }
   if(this.Donnabox.isSelected()){double[] res=this.converti(EU, Uk, Usa, false, true);
                                  ncalzata.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "10", "10.5", "11", "11.5", "12", "12.5", "13", "13.5", 
                                                                                                        "14"}));
                                   ncalzata.setSelectedIndex(returnUkIndex(Uk));
                                
                                  refresh();
   }
   
   if(this.UomoBox.isSelected()){double[] res=this.converti(EU, Uk, Usa, false, false);
                                  ncalzata.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "10", "10.5", "11", "11.5", "12", "12.5", "13", "13.5", 
                                                                                                        "14"}));
                                  ncalzata.setSelectedIndex(returnUkIndex(Uk));
                                  
                                  refresh();
   }
   }
   
    }//GEN-LAST:event_UkboxMouseClicked

    private void jMenuItem1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuItem1MouseReleased
    this.Pannellogenerale.setVisible(false);   
    // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem1MouseReleased

    private void jMenuItem2MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuItem2MouseReleased
     this.setVisible(false);        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem2MouseReleased

    private void ingrandisciMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ingrandisciMouseReleased
    if(this.getExtendedState()==MAXIMIZED_BOTH) this.setExtendedState(NORMAL);   
    else this.setExtendedState(MAXIMIZED_BOTH);
    // TODO add your handling code here:
    }//GEN-LAST:event_ingrandisciMouseReleased

	private void menuRicercaBaseMouseReleased(java.awt.event.MouseEvent evt) {
	ApriModelloBase rb = new ApriModelloBase (this,true);
	rb.setVisible(true);// TODO add your handling code here:
	}

	private void menuNuovoModelloBaseMouseReleased(java.awt.event.MouseEvent evt) {
		NuovoModelloBase nl = new NuovoModelloBase(this,true);
		nl.setVisible(true);// TODO add your handling code here:
                
	}

	private void jMenuItem5MouseReleased(java.awt.event.MouseEvent evt) {
		ApriLinea al = new ApriLinea(this,true);
                al.setVisible(true);
	}

	private void jMenuItem5MousePressed(java.awt.event.MouseEvent evt) {
		// TODO add your handling code here:
	}

	private void jMenuItem4MouseReleased(java.awt.event.MouseEvent evt) {
		NuovaLinea nl = new NuovaLinea(this, true);
		nl.setVisible(true);// TODO add your handling code here:
	}

	private void jMenuItem4MousePressed(java.awt.event.MouseEvent evt) {
		NuovaLinea nl = new NuovaLinea(this, true);
		nl.setVisible(true);
	}

	private void aprischeda1MouseReleased(java.awt.event.MouseEvent evt) {
		// TODO add your handling code here:
	}

	private void aprischeda1MousePressed(java.awt.event.MouseEvent evt) {
		ApriScheda rs = new ApriScheda(this, true);
		rs.setVisible(true);
	}

	private void jMenu4MouseReleased(java.awt.event.MouseEvent evt) {
		// TODO add your handling code here:
	}

	private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	

	private void schedaMousePressed(java.awt.event.MouseEvent evt) {
		
	}
        private void schedaMouseReleased(java.awt.event.MouseEvent evt) {
		
	}
        private double[] converti (int EU,double UK,double Usa,Boolean Bimbo,Boolean Donna){
        if ( EU!=-1){
        double pollici =(((2/3)*EU)/2.5)*3;
        if(Bimbo){UK=pollici-12;
                  Usa=pollici-11.67;}
        if(Donna){UK=pollici-25.5;
                  Usa=pollici-22.5;}
        if(!Donna && !Bimbo){UK=pollici-25;
                             Usa=pollici-24;}
        double[] res=new double[3];
        res[0]=EU;
        res[1]=UK;
        res[2]=Usa;
        return res;
        }
        
        if ( UK!=-1){
            if(Bimbo){
                double pollici=UK+12;
                Usa=pollici-11.67;
                EU=(int) Math.round((pollici/3)*2.5*(3/2));
                }
            if(Donna){
                double pollici=UK+25.5;
                Usa=pollici-22.5;
                EU=(int) Math.round((pollici/3)*2.5*(3/2));
            }
            if(!Donna && !Bimbo){
                double pollici=UK+25;
                Usa=pollici-24;
                EU=(int) Math.round((pollici/3)*2.5*(3/2));
            }
             double[] res=new double[3];
        res[0]=EU;
        res[1]=UK;
        res[2]=Usa;
        return res;
        
        }  
        
        if(Usa!=-1){
              if(Bimbo){
                double pollici=Usa+11.67;
                UK=pollici-12;
                EU=(int) Math.round((pollici/3)*2.5*(3/2));
                }
            if(Donna){
                double pollici=Usa+22.5;
                UK=pollici-25.5;
                EU=(int) Math.round((pollici/3)*2.5*(3/2));
            }
            if(!Donna && !Bimbo){
                double pollici=Usa+24;
                UK=pollici-25;
                EU=(int) Math.round((pollici/3)*2.5*(3/2));
            }
             double[] res=new double[3];
        res[0]=EU;
        res[1]=UK;
        res[2]=Usa;
        return res;
        
        
        
        
        }
        
        double[] res=new double[3];
        res[0]=EU;
        res[1]=UK;
        res[2]=Usa;
        return res;
 }
         public void refresh(){ //ricarica la grafica
         this.ncalzata.validate();
         this.ncalzata.repaint();
         this.ncalzata.doLayout();
             
         this.pannelloInfo.validate();
         this.pannelloInfo.repaint();
         this.pannelloInfo.doLayout();
         jPanel2.validate();
         jPanel2.repaint();
         jPanel2.doLayout();}

	/**
	 * @param args the command line arguments
	 */

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem Apribase;
    private javax.swing.JMenuItem Aprischeda;
    private javax.swing.JCheckBox Bimbobox;
    private javax.swing.JButton Cancellalogselezionato;
    private javax.swing.JMenuItem CercaComp;
    private javax.swing.JMenuItem Cercasped;
    private javax.swing.JCheckBox Donnabox;
    private javax.swing.JCheckBox EUbox;
    private javax.swing.JPanel Pannellocomp;
    private javax.swing.JPanel Pannellogenerale;
    private javax.swing.JCheckBox Ukbox;
    private javax.swing.JCheckBox UomoBox;
    private javax.swing.JCheckBox Usabox;
    private javax.swing.JMenuItem agenins;
    private javax.swing.JMenu agenti;
    private javax.swing.JMenuItem aggiungi;
    private javax.swing.JToggleButton apribottonemenu;
    private javax.swing.JToggleButton aprilog;
    private javax.swing.JMenuItem cercains;
    private javax.swing.JMenuItem cercaordine;
    private javax.swing.JMenuItem cerfor;
    private javax.swing.JMenuItem clicerca;
    private javax.swing.JMenu clienti;
    private javax.swing.JMenuItem cliinserisci;
    private javax.swing.JMenu commerciale;
    private javax.swing.JMenuItem comsped;
    private javax.swing.JButton confronta;
    private javax.swing.Box.Filler filler1;
    private javax.swing.JMenu forn;
    private javax.swing.JPanel immagine1;
    private javax.swing.JPanel immagine2;
    private javax.swing.JMenuItem impscbase;
    private javax.swing.JMenu ingrandisci;
    private javax.swing.JMenuItem insfor;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton15;
    private javax.swing.JButton jButton16;
    private javax.swing.JButton jButton17;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton21;
    private javax.swing.JButton jButton22;
    private javax.swing.JButton jButton23;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton7;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JFormattedTextField jFormattedTextField1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenu jMenu7;
    private javax.swing.JMenu jMenu8;
    private javax.swing.JMenu jMenu9;
    private javax.swing.JMenuBar jMenuBar4;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JSeparator jSeparator6;
    private javax.swing.JSeparator jSeparator7;
    private javax.swing.JPopupMenu.Separator jSeparator8;
    private javax.swing.JPopupMenu.Separator jSeparator9;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTabbedPane jTabbedPane3;
    private javax.swing.JTabbedPane jTabbedPane4;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable4;
    private javax.swing.JTable jTable5;
    private javax.swing.JTable jTable6;
    private javax.swing.JTable jTable7;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField10;
    private javax.swing.JTextField jTextField11;
    private javax.swing.JTextField jTextField14;
    private javax.swing.JTextField jTextField16;
    private javax.swing.JTextField jTextField17;
    private javax.swing.JTextField jTextField9;
    private javax.swing.JToggleButton jToggleButton2;
    private javax.swing.JToggleButton jToggleButton3;
    private javax.swing.JToggleButton jToggleButton5;
    private javax.swing.JButton log;
    private javax.swing.JMenuItem menuNuovoModelloBase;
    private javax.swing.JComboBox ncalzata;
    private javax.swing.JMenuItem nuova;
    private javax.swing.JPanel pannelloInfo;
    private javax.swing.JPanel pannelloLog;
    private javax.swing.JPanel pannellofoto;
    private javax.swing.JMenuItem salva;
    private javax.swing.JButton salvabottone;
    private javax.swing.JMenuItem salvaconnome;
    private javax.swing.JMenu scheda;
    private javax.swing.JMenuItem schedaprodotto;
    private javax.swing.JTable tabellacomp;
    // End of variables declaration//GEN-END:variables

    private void inizializeTabella()
    {           
        
        
                 JComboBox qta=new JComboBox();
                for(int j=0;j<=50;j++)
                qta.addItem(new Integer(j));
                qta.setSelectedIndex(0);
                qta.setOpaque(true);
                qta.setVisible(true);
                
                
                JComboBox qtb=new JComboBox();
                for(int k=0;k<37;k++)
                qtb.addItem(new Integer(k+13));
                qtb.setSelectedIndex(14);
                qtb.setOpaque(true);
                qtb.setVisible(true);
                
                 JComboBox qtc=new JComboBox();
                 qtc.setOpaque(true);
                qtc.setVisible(true);
                
                
                
                JTextField f=new JTextField();
                f.setBackground(Color.LIGHT_GRAY);
                f.setOpaque(true);
                
                
        
        
        
                Object [][] ObjectData=new Object[50][5];
                for (int i=0;i<50;i++)
                {JLabel lab1=new JLabel();
                lab1.setOpaque(true);
                lab1.setBackground(Color.GRAY);
                lab1.setForeground(Color.WHITE);
                lab1.setText("  "+Integer.toString(i+1));
                
                JLabel lab2=new JLabel();
                lab2.setOpaque(true);
                lab2.setBackground(Color.DARK_GRAY);
                lab2.setForeground(Color.WHITE);
                
                  JLabel lab3=new JLabel();
                lab3.setOpaque(true);
                lab3.setBackground(Color.DARK_GRAY);
                lab3.setForeground(Color.WHITE);
                
               
                    
                    
     
                 ObjectData[i][0]=lab1;
                 ObjectData[i][1]=lab2;
                 ObjectData[i][2]=null;
                 ObjectData[i][3]=null;
                 ObjectData[i][4]=null;
                
                }
               tabellacomp.setForeground(Color.white); 
              
               tabellacomp.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
               tabellacomp.setModel(new javax.swing.table.DefaultTableModel(
               
                       
                       
              ObjectData,
            new String [] {
                "", "Posizione", "Componente", "Quantità", "Taglia"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Boolean.class, JLabel.class, String.class, JComboBox.class, JComboBox.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabellacomp.setToolTipText("");
                
                tabellacomp.getColumnModel().getColumn(0).setCellEditor(new PanelEditor());
                tabellacomp.getColumnModel().getColumn(0).setCellRenderer(new PanelRenderer());
                tabellacomp.getColumnModel().getColumn(1).setCellEditor(new PanelEditor());
                tabellacomp.getColumnModel().getColumn(1).setCellRenderer(new PanelRenderer());
                tabellacomp.getColumnModel().getColumn(2).setCellEditor(new DefaultCellEditor(f));
                tabellacomp.getColumnModel().getColumn(2).setCellRenderer(new PanelRenderer());
                tabellacomp.getColumnModel().getColumn(3).setCellEditor(new DefaultCellEditor(qta));
    
                tabellacomp.getColumnModel().getColumn(4).setCellEditor(new DefaultCellEditor(qtb));
      
                tabellacomp.setBounds(0,0,102, this.tabellacomp.getHeight());
                tabellacomp.getColumnModel().getColumn(0).setPreferredWidth(2);
                tabellacomp.getColumnModel().getColumn(2).setPreferredWidth(20);
                 tabellacomp.getColumnModel().getColumn(2).setPreferredWidth(200);
                tabellacomp.getColumnModel().getColumn(3).setPreferredWidth(5);
                tabellacomp.getColumnModel().getColumn(4).setPreferredWidth(5);
                tabellacomp.setRowHeight(15);
                
        
       refresh();     
                  
    }
    
    private void inizialize() {
       this.Pannellogenerale.setVisible(false);
                this.setLayout(new BorderLayout());
                this.add("Center",this.Pannellogenerale);
                this.salva.setVisible(false);
                this.salvaconnome.setVisible(false);
             
                this.inizializeTabella();
                this.scheda.requestFocusInWindow();
                this.ncalzata.setSelectedIndex(27);
                this.EUbox.setSelected(true);
                
                Set<AWTKeyStroke> set, newSet;

                set = this.getFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
                newSet = new HashSet<AWTKeyStroke> (set);
                newSet.add (KeyStroke.getKeyStroke (KeyEvent.VK_LEFT, 0));
                this.setFocusTraversalKeys (KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, newSet);

                set = this.getFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
                newSet = new HashSet<AWTKeyStroke> (set);
                newSet.add (KeyStroke.getKeyStroke (KeyEvent.VK_RIGHT, 0));
                this.setFocusTraversalKeys (KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, newSet);
               this.gestionegrafica();
                refresh();
    }
    
     private void gestionegrafica(){

   
        
         
        sfondobase=new JLabel();  
        sfondobase.setBounds(0, 0, this.getWidth()+100, this.getHeight()+100);
        sfondobase.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sfondomenu.png"))); // NOI18N
        sfondobase.setToolTipText("");  
        sfondobase.setVisible(true);
        this.add(sfondobase); 
         
         
        sfondo=new JLabel();  
        sfondo.setBounds(0, 0, this.getWidth()+100, this.getHeight()+100);
        sfondo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sfondomenu.png"))); // NOI18N
        sfondo.setToolTipText("");  
        sfondo.setVisible(true);
        this.Pannellogenerale.add(sfondo);
        Pannellogenerale.setOpaque(false);
        
        sfondobarra=new JLabel();  
        sfondobarra.setBounds(0, 0, this.jPanel1.getWidth()+100, this.jPanel1.getHeight()+100);
        sfondobarra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/barrasuperioremenu.png"))); // NOI18N
        sfondobarra.setToolTipText("");  
        sfondobarra.setVisible(true);
        this.jPanel1.add(sfondobarra);
        jPanel1.setOpaque(false);
        
         sfondobarra2=new JLabel();  
        sfondobarra2.setBounds(0, 0, this.Pannellocomp.getWidth(), jPanel4.getHeight());
        sfondobarra2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/barrasuperioremenu.png"))); // NOI18N
        sfondobarra2.setToolTipText("");  
        sfondobarra2.setVisible(true);
        this.Pannellocomp.setLayout(null);
        this.Pannellocomp.add(sfondobarra2);
        jPanel4.setOpaque(false);
       
        sfondobarra3=new JLabel();  
        sfondobarra3.setBounds(0, 0, this.Pannellocomp.getWidth(), this.Pannellocomp.getHeight()-jPanel4.getHeight());
        sfondobarra3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sfondopannello.png"))); // NOI18N
        sfondobarra3.setToolTipText("");  
        sfondobarra3.setVisible(true);
        this.Pannellocomp.setLayout(null);
        this.Pannellocomp.add(sfondobarra3);
        Pannellocomp.setOpaque(false);
        this.jTabbedPane2.setOpaque(false);
        
        sfondobarra4=new JLabel();  
        sfondobarra4.setBounds(0, 0, this.jPanel2.getWidth(), this.jPanel2.getHeight());
        sfondobarra4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sfondopannello.png"))); // NOI18N
        sfondobarra4.setToolTipText("");  
        sfondobarra4.setVisible(true);
        this.jPanel2.setLayout(null);
        this.jPanel2.add(sfondobarra3);
        jPanel2.setOpaque(false);
        
         sfondobarra6=new JLabel();  
        sfondobarra6.setBounds(0, 0, this.pannelloInfo.getWidth(), this.pannelloInfo.getHeight());
        sfondobarra6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sfondopannello.png"))); // NOI18N
        sfondobarra6.setToolTipText("");  
        sfondobarra6.setVisible(true);
       
        this.pannelloInfo.add(sfondobarra6);
        pannelloInfo.setOpaque(false);
        
        sfondobarra5=new JLabel();  
        sfondobarra5.setBounds(0, 0, this.pannelloInfo.getWidth(), jPanel3.getHeight());
        sfondobarra5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/barrasuperioremenu.png"))); // NOI18N
        sfondobarra5.setToolTipText("");  
        sfondobarra5.setVisible(true);
        this.jPanel3.add(sfondobarra5);
       
        sfondobarra7=new JLabel();  
        sfondobarra7.setBounds(0, 0, this.pannelloLog.getWidth(), jPanel10.getHeight());
        sfondobarra7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/barrasuperioremenu.png"))); // NOI18N
        sfondobarra7.setToolTipText("");  
        sfondobarra7.setVisible(true);
        this.jPanel10.add(sfondobarra7);
        
         sfondobarra8=new JLabel();  
        sfondobarra8.setBounds(0, 0, this.pannellofoto.getWidth(), jPanel5.getHeight());
        sfondobarra8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/barrasuperioremenu.png"))); // NOI18N
        sfondobarra8.setToolTipText("");  
        sfondobarra8.setVisible(true);
        this.jPanel5.add(sfondobarra8);
        
        pannellofoto.setOpaque(false);
       
        
        
       
    }
    
    
    
    private int returnUkIndex(double Uk) {
        double i=0;
        int index=0;
        while(i<=14)
        {if(i<=Uk && Uk<=i+0.5) return 1;i=i+0.5;}
        return index;
        
    }
    
}